package com.qen.sheji.guanchazhe;

import java.util.ArrayList;
import java.util.List;

public class PublisherImpl implements Publisher {
    private List<Observer> list = new ArrayList<>();

    @Override
    public void register(Observer observer) {
        list.add(observer);
    }

    @Override
    public void notify(Object o) {
        for (int i = 0; i < list.size(); i++) {
            list.get(i).notify(o);
        }
    }
}
